<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>cms日志管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			  $(".form_datetime").datetimepicker({ 
				  language:'zh-CN',
				  todayBtn: true,
				  autoclose: true,
				  format: 'yyyy-mm-dd'});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			layer.load(1, {
			    shade: [0.3,'#000'] //0.1透明度的白色背景
			});
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<form:form id="searchForm" action="${ctx}/system/log" method="post"  class="form-inline ibox-content" >
	  <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
	  <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	  <div>
	  	  <div class="form-group">
		    <input type="text" id="title" name="title" maxlength="50" value="${log.title}" class="form-control" placeholder="操作菜单">
		  </div>
		  <div class="form-group">
		    <input type="text" id="createBy.id" name="createBy.id" maxlength="50" value="${log.createBy.id}" class="form-control" placeholder="用户ID">
		  </div>
		  <div class="form-group">
		    <input type="text" id="requestUri" name="requestUri" maxlength="50"  value="${log.requestUri}" class="form-control" placeholder="URI">
		  </div>
	      <div class="form-group" id="data_5">
            <div class="input-daterange input-group" id="datepicker">
            	<input type="text" class="input-sm form-control form_datetime" name="beginDate" id="beginDate" value="<fmt:formatDate value="${log.beginDate}" pattern="yyyy-MM-dd"/>">
                <span class="input-group-addon">到</span>
                <input type="text" class="input-sm form-control form_datetime" name="endDate" id="endDate" value="<fmt:formatDate value="${log.endDate}" pattern="yyyy-MM-dd"/>">
            </div>
          </div> 
		  <button type="submit" class="btn btn-primary">查询</button>
	  </div>	  
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th>操作菜单</th><th>操作用户</th><th>URI</th><th>提交方式</th><th>操作者IP</th><th>操作时间</th></thead>
		<tbody><%request.setAttribute("strEnter", "\n");request.setAttribute("strTab", "\t");%>
		<c:forEach items="${page.list}" var="log">
			<tr>
				<td>${log.title}</td>
				<td>${log.createBy.name}</td>
				<td><strong>${log.requestUri}</strong></td>
				<td>${log.method}</td>
				<td>${log.remoteAddr}</td>
				<td><fmt:formatDate value="${log.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
			</tr>
			<c:if test="${not empty log.exception}"><tr>
				<td colspan="8" style="word-wrap:break-word;word-break:break-all;">
					异常信息: <br/>
					${fn:replace(fn:replace(fns:escapeHtml(log.exception), strEnter, '<br/>'), strTab, '&nbsp; &nbsp; ')}</td>
			</tr></c:if>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
